package com.middle.common.context;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * 获取spring上下文
 * @author KING
 *
 */
@Lazy(value=false)
@Component
public class ApplicationContextHelper implements org.springframework.context.ApplicationContextAware {

	private static ApplicationContext act;
	
	@Override
	public void setApplicationContext(ApplicationContext context) throws BeansException {
		act = context;
	}
	
	public static ApplicationContext getApplicationContext(){
		return act;
	}

}
